function require() {
	this.requestMethods = (method = 'get', url = "", data = {}) => {
		return new Promise((res, rej) => {
			uni.request({
				url: url,
				data,
				method: method || 'GET',
				// header:{}
				success(e) {
					console.log(e);
				}
			})
		})
	}
}
const http = new require()

function request(method = 'get', url = "", data = {}) {
	method = method.toUpperCase()
	if (method === "GET") {
		return http.requestMethods("GET", url, data)
	}
	if (method === "POST") {
		return http.requestMethods("POST", url, data)
	}
	if (method === "PUT") {
		return http.requestMethods("PUT", url, data)
	}
	if (method === "DELEDE") {
		return http.requestMethods("DELEDE", url, data)
	}
}

export default request